package com.zqcy.workbench.adapter;

import android.content.Context;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.onemdos.base.message.protocal.msgstruct.MsgConf;
import com.zqcy.workbench.R;
import com.zqcy.workbench.utils.Utils;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.Random;

public class InformationAdapter extends BaseQuickAdapter<MsgConf, BaseViewHolder> {

    private Context context;

    public InformationAdapter(Context context, @Nullable List<MsgConf> data) {
        super(R.layout.item_information, data);
        this.context = context;
    }

    @Override
    protected void convert(@NotNull BaseViewHolder helper, MsgConf item) {
        helper.setText(R.id.information_name, "测试" + new Random().nextInt(1000));
        helper.setText(R.id.information_time, Utils.getstampToDate(item.getMsgTask().getSendTime() * 1000));
        helper.setText(R.id.information_content, item.getMsgBody().getContent());
        helper.setText(R.id.information_title, item.getMsgBody().getTitle());
    }
}
